package cn.tedu.charging.user.dao.repository.Impl;



import cn.tedu.charging.common.pojo.vo.UserInfoVO;
import cn.tedu.charging.user.dao.mapper.UserVehicleMapper;
import cn.tedu.charging.user.dao.repository.ChargingUserVehicleRepository;
import cn.tedu.charging.user.pojo.po.ChargingUserVehicleBindPO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;


@Slf4j
@Repository
public class ChargingUserVehicleRepositoryImpl implements ChargingUserVehicleRepository {

    @Autowired
    private UserVehicleMapper userVehicleMapper;

    @Override
    public UserInfoVO selectUserInfoByUserId(Integer userId) {
        UserInfoVO userInfoVO=new UserInfoVO();
        log.debug("开始处理用户查询业务，参数：{}", userId);
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("user_id",userId);
        ChargingUserVehicleBindPO chargingUserVehicleBindPO = userVehicleMapper.selectOne(queryWrapper);
        userInfoVO.setCarId(chargingUserVehicleBindPO.getVehicleId());
        return userInfoVO;


    }
}
